﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true"
    CodeBehind="News.aspx.cs" Inherits="MLM.AdminCP.Pages.News" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
Lastest News
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div class="News">
        <asp:ListView ID="NewsViews" runat="server" GroupItemCount="3" DataSourceID="GroupNewsEds"
            DataKeyNames="NewsID">
            <LayoutTemplate>
                <div runat="server" id="tblNew">
                    <div runat="server" id="groupPlaceholder">
                        <div class="Title">
                            <h3 class="MLM_AdminCP_News_Title">
                                <%# Eval("Title")%></h3>
                        </div>
                        <div id="Detail">
                            <b>
                                <%# Eval("Detail")%></b>
                        </div>
                    </div>
                </div>
                <div id="divPager">
                    <asp:DataPager runat="server" ID="DataPager" PageSize="3">
                        <Fields>
                            <asp:TemplatePagerField>
                                <PagerTemplate>
                                    &nbsp;
                                    <asp:TextBox ID="CurrentRowTextBox" runat="server" AutoPostBack="True" Text="<%# Container.StartRowIndex + 1 %>"
                                        Columns="1" Style="text-align: right" 
                                        OnTextChanged="CurrentRowTextBox_OnTextChanged" 
                                        meta:resourcekey="CurrentRowTextBoxResource1" />
                                    to
                                    <asp:Label ID="PageSizeLabel" runat="server" Font-Bold="True" 
                                        Text="<%# Container.StartRowIndex + Container.PageSize > Container.TotalRowCount ? Container.TotalRowCount : Container.StartRowIndex + Container.PageSize %>" 
                                        meta:resourcekey="PageSizeLabelResource1" />
                                    of
                                    <asp:Label ID="TotalRowsLabel" runat="server" Font-Bold="True" 
                                        Text="<%# Container.TotalRowCount %>" 
                                        meta:resourcekey="TotalRowsLabelResource1" />
                                </PagerTemplate>
                            </asp:TemplatePagerField>
                            <asp:NextPreviousPagerField ShowFirstPageButton="True" ShowLastPageButton="True"
                                FirstPageText="|<< " LastPageText=" >>|" NextPageText=" > " 
                                PreviousPageText=" < " meta:resourcekey="NextPreviousPagerFieldResource1" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </LayoutTemplate>
            <GroupTemplate>
                <div runat="server" id="newRow">
                    <div runat="server" id="itemPlaceholder">
                    </div>
                </div>
            </GroupTemplate>
            <ItemTemplate>
                <div class="itemNew">
                    <div class="Title">
                       <h3 class="MLM_AdminCP_News_Title">
                            <%# Eval("Title")%></h3>
                    </div>
                    <div style="height: 10px;">
                    </div>
                    <div class="Detail">
                        <%# Eval("Detail")%></b>
                    </div>
                    <div style="height: 10px;">
                    </div>
                </div>
            </ItemTemplate>
        </asp:ListView>
    </div>
    <asp:EntityDataSource ID="GroupNewsEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableFlattening="False" 
        EntitySetName="News" OrderBy="it.CreatedDate DESC">
    </asp:EntityDataSource>
</asp:Content>
